﻿<UserControl x:Class="SGGWElevator.ElevatorCaller"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d">
    <UserControl.Resources>
        
        <!--ImageButton-->
        <Style TargetType="{x:Type Button}">
            
            <!--ImageButton common properties-->
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="BorderThickness" Value="0" />
            
            <!--ImageButton structure-->
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <ContentPresenter Content="{TemplateBinding Content}" />
                    </ControlTemplate>                    
                </Setter.Value>                
            </Setter>

            <!--ImageButton content type-->
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <Image Source="{Binding}"/>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    
    <Grid x:Name="ArrowsGrid" Width="75" Height="86" >
        <Grid.RowDefinitions>
            <RowDefinition x:Name="ArrowUpRow" Height="*" />
            <RowDefinition x:Name="ArrowDownRow" Height="*"/>
        </Grid.RowDefinitions>
        <Button x:Name="ArrowUp" Click="OnButtonClick" Grid.Row="0" VerticalContentAlignment="Center" HorizontalAlignment="Center">
            <Image Source="/Images/ElevatorCallers/CallerUpOff.png" Stretch="None"/>
        </Button>
        <Button x:Name="ArrowDown" Click="OnButtonClick" Grid.Row="1" VerticalContentAlignment="Center" HorizontalAlignment="Center">
            <Image Source="/Images/ElevatorCallers/CallerDownOff.png" Stretch="None"/>
        </Button>
    </Grid>
</UserControl>
